﻿<%@ MasterType VirtualPath="~/SiteNavigation.master" %>
<%@ page title="" language="C#" masterpagefile="~/SiteNavigation.master" autoeventwireup="true" inherits="Faculty_AllFacultyInfo, App_Web_ziqa4uiw" maintainscrollpositiononpostback="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <div style="width: 945px">
        <asp:Label ID="FacultyNameLabel" runat="server" Text="Name: "></asp:Label>
        <asp:TextBox ID="FacultyNameTextBox" runat="server" Width="191px"></asp:TextBox>

    &nbsp;
        <asp:Label ID="FacultyDesignationLabel" runat="server" Text="Designation: "></asp:Label>
        <asp:TextBox ID="FacultyDesignationTxtBx" runat="server"></asp:TextBox>
        <br />
        <asp:Label ID="Label1" runat="server" Text="Email: "></asp:Label>
        <asp:TextBox ID="FacultyEmailTxtBox" runat="server" Width="185px"></asp:TextBox>
&nbsp;<asp:Label ID="Label2" runat="server" Text="Phone: "></asp:Label>
        <asp:TextBox ID="FacultyPhoneTxtBx" runat="server" Width="150px"></asp:TextBox>
&nbsp;
        <asp:Label ID="Label3" runat="server" Text="Location: "></asp:Label>
        <asp:TextBox ID="FacultyLocationTxtBx" runat="server"></asp:TextBox>
        <br />
        <asp:HiddenField ID="FacultyAutoIdHiddenField" runat="server" />
        <br />
        <asp:Button ID="FacultySearchButton" runat="server" 
            onclick="FacultySearchButton_Click" oncommand="FacultySearchButton_Command" 
            Text="Search" Width="79px" />
&nbsp;&nbsp;
        <asp:Button ID="FacultyUpdatButton" runat="server" 
            onclick="FacultyUpdatButton_Click" Text="Update" Width="71px" />
&nbsp;&nbsp;
        <asp:Button ID="FacultyAddButton" runat="server" 
            onclick="FacultyAddButton_Click" Text="Add" Width="74px" />
&nbsp;&nbsp;
        <asp:Button ID="FacultyDeleteButton" runat="server" Text="Delete" 
            Width="80px" onclick="FacultyDeleteButton_Click" />
        <br />
        <hr />

    </div>
    <div>

        <asp:GridView ID="FacultyInfoGridView" runat="server" 
            AutoGenerateColumns="False" DataKeyNames="FacultyAutoId" 
            EnableModelValidation="True" ShowFooter="True" 
            onrowcancelingedit="FacultyGridRowCancellingCommand" 
            onrowcommand="FacultyGridRowCommand" onrowediting="FacultyGridEditCommand" 
            onrowdeleting="FacultyInfoGridView_RowDeleting" OnRowUpdating = "FacultyInfoGridView_RowUpdating"
            >
            <Columns>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" 
                            CommandName="Select" Text="Select" CommandArgument='<%# ((GridViewRow)Container).RowIndex %>'></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Edit" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                            CommandName="Update" Text="Update"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButtonUpdate" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandName="AddNew">Add New</asp:LinkButton>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Edit" Text="Edit"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Name" SortExpression="Name">
                    <EditItemTemplate>
                        <asp:TextBox ID="FacultyNameGridEditTxtBx" runat="server" 
                            Text='<%# Bind("Name") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="FacultyNameGridFooterTxtBx" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FacultyNameGridViewLabel" runat="server" 
                            Text='<%# Bind("Name") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Designation" SortExpression="Designation">
                    <EditItemTemplate>
                        <asp:TextBox ID="FacultyDesignationGridEditTxtBx" runat="server" 
                            Text='<%# Bind("Designation") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="FacultyDesignationGridFooterTxtBx" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FacultyDesignationGridViewLabel" runat="server" 
                            Text='<%# Bind("Designation") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Email" SortExpression="Email">
                    <EditItemTemplate>
                        <asp:TextBox ID="FacultyEmailGridEditTxtBx" runat="server" 
                            Text='<%# Bind("Email") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="FacultyEmailGridFooterTxtBx" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FacultyEmailGridViewLabel" runat="server" 
                            Text='<%# Bind("Email") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Phone" SortExpression="Phone">
                    <EditItemTemplate>
                        <asp:TextBox ID="FacultyPhoneGridEditTxtBx" runat="server" 
                            Text='<%# Bind("Phone") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="FacultyPhoneGridFooterTxtBx" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FacultyPhoneGridViewLabel" runat="server" 
                            Text='<%# Bind("Phone") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Location" SortExpression="Location">
                    <EditItemTemplate>
                        <asp:TextBox ID="FacultyLocationGridEditTxtBx" runat="server" 
                            Text='<%# Bind("Location") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="FacultyLocationGridFooterTxtBx" runat="server"></asp:TextBox>
                    </FooterTemplate>
                    <ItemTemplate>
                        <asp:Label ID="FacultyLocationGridViewLabel" runat="server" 
                            Text='<%# Bind("Location") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete">
                    <ItemTemplate>
                        <span onclick="return confirm('Are you sure to Delete the record? It will delete all the assigned courses, Assignment and Projects')" >
                            <asp:LinkButton ID="LinkButtonDelete" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="Delete"></asp:LinkButton>
                          </span>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

    </div>
</asp:Content>

